<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<form class="form-horizontal form-bordered form-label-stripped form-validation form-myt-md-commodity-erp-update"
	action="${base}/myt/md/commodity!erpCommodityUpdate" method="post" 
	enctype="multipart/form-data" >
	<s:hidden name="id" />
	<s:hidden name="version" />
	<s:token />
	<input type="hidden" name="solrFilterType" value="LM">
	<div class="form-actions">
		<button class="btn blue" type="submit" data-grid-reload=".grid-myt-md-commodity-erp-update">
			<i class="fa fa-check"></i> 同步
		</button>
		<button class="btn default btn-cancel" type="button">取消</button>
	</div>
	<div class="form-body">
        <div class="row">
			<div class="col-md-12">
				<div class="form-group">
					<label class="control-label col-md-3">Excel</label>
					<div class="col-md-4">
						<input type="file" class="default" name="erpExcel"/>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-md-12">
				<div class="form-group">
					<label class="control-label col-md-4">同步方式</label>
					<div class="col-md-8">
						<s:radio name="updateType" list="#{'COMMODITY_NEW':'新品建立','COMMODITY_UPDATE':'旧品更新','UPDATE_PRICE':'更新成本价'}"
							value="'COMMODITY_NEW'" />
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-md-12">
				<div class="form-group">
					<label class="control-label col-md-3">Excel模板示例</label>
					<div class="col-md-4">
						<p class="form-control-static">
							<a href="${base}/myt/md/import-erp-commodity.xlsx">新品建立excel模板</a>
							<a href="${base}/myt/md/update-price-commodity.xlsx">更新成本价</a>
						</p>
						
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="form-actions right">
		<button class="btn blue" type="submit" data-grid-reload=".grid-myt-md-commodity-erp-update">
			<i class="fa fa-check"></i> 同步
		</button>
		<button class="btn default btn-cancel" type="button">取消</button>
	</div>
</form>
<!-- <script type="text/javascript">
$(function() {
     $(".form-myt-md-commodity-erp-update").data("formOptions", {
         var $form = $(this);
         $form.submit(function(event) {
             var url='${base}/myt/md/commodity!erpCommodityUpdate'
             $form.ajaxPostURL({
                 url : url,
                 success : function() {
                     $grid.refresh();
                 },
                 confirmMsg : "确认  导入到商品？",
                 data : {
                     ids : ids.join(",")
                 }
             })
             $voucher.focus();
             $voucher.select();
             event.preventDefault();
             event.stopPropagation();
             return false;
         })
            bindEvents : function() {
               
                $form.find(".fa-select-floor").click(function() {
                    $(this).popupDialog({
                        url :'${base}/myt/md/floor!forward?_to_=selection',
                        title : '选取楼层',
                        callback : function(rowdata) {
                            $form.setFormDatas({
                                'floor.id' : rowdata.id,
                                'floor.displayLabel' : rowdata.displayLabel
                            });

                        }
                    })
                });
                $form.setFormDatas({
                    commodityAmount : commodityAmount,
                    totalTaxAmount : totalTaxAmount,
                    commodityAndTaxAmount : commodityAndTaxAmount,
                    discountAmount : userData.discountAmount,
                    totalOriginalAmount : userData.originalAmount,
                    totalAmount : totalAmount,
                    payedAmount : totalAmount
                });
            }
    });
});
</script> -->
<%@ include file="/common/ajax-footer.jsp"%>